<script setup>
import { inject, computed } from 'vue';

const fileStore = inject('fileStore');

const props = defineProps({
  processing: {
    type: Boolean,
    required: true
  },
  processed: {
    type: Boolean,
    required: true
  }
});

const processed__ = computed(() => {
  return props.processed;
});

const emit = defineEmits(['process', 'download']);
</script>

<template>
  <div class="action-buttons">
    <el-button
      type="primary"
      :loading="processing"
      :disabled="!fileStore.isProcessable"
      @click="$emit('process')"
      class="process-btn"
    >
      <i-ep-MagicStick class="mr-2" v-if="!processing" />
      {{ processing ? '正在处理...' : '开始处理' }}
    </el-button>
    <el-button v-if="processed__" type="success" @click="$emit('download')" class="download-btn">
      <i-ep-Download class="mr-2" />
      下载结果
    </el-button>
  </div>
</template>

<style scoped>
.action-buttons {
  display: flex;
  gap: 16px;
  margin: 24px 0;
}

.process-btn,
.download-btn {
  flex: 1;
  height: 48px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.process-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(103, 194, 58, 0.4);
}

@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
  }

  .process-btn,
  .download-btn {
    height: 44px;
  }
}
</style>
